package com.qf.service.impl;

import com.qf.common.Dto.OrderDto;
import com.qf.common.utils.SnowflakeKeyGenerator;
import com.qf.mapper.OrderItemMapper;
import com.qf.mapper.OrderMapper;
import com.qf.mapper.StockMapper;
import com.qf.service.OrderAppService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author KING
 * @ClassName: com.qf.service.impl.OrderAppServiceImpl
 * @Description: 该类的功能描述
 * @date: 2021/10/30 10:11
 */
@Service
public class OrderAppServiceImpl implements OrderAppService {
    @Resource
    private OrderMapper orderMapper;
    @Resource
    private OrderItemMapper orderItemMapper;
    @Resource
    private StockMapper stockMapper;

    /**
     * 创建订单
     * * 1 生成订单号
     * * 2 保存订单主表 订单详情表
     * * 3 减少库存
     * * 4 计算总金额
     * * 5 删除购物车数据
     *
     * @param orderDto
     * @return
     */
    @Override
    @Transactional(rollbackFor = RuntimeException.class)
    public Boolean addOrder(OrderDto orderDto) {
        return null;
    }
}
